import { defHttp } from '../http'
import type { CommonAPI } from '../schema/all'
/**
 * @description: WAF
 */

/** 更新WAF */
export const updateApiWafApi: CommonAPI<'/api/waf', 'put'> = (data) =>
  defHttp.put(`/api/waf`, { data })

/** 创建WAF */
export const addApiWafApi: CommonAPI<'/api/waf', 'post'> = (data) =>
  defHttp.post(`/api/waf`, { data })

/** 删除WAF */
export const deleteApiWafApi: CommonAPI<'/api/waf', 'delete'> = (data) =>
  defHttp.delete(`/api/waf`, { data })

/** 修改绑定WAF */
export const updateApiWafBindApi: CommonAPI<'/api/waf/bind', 'put'> = (data) =>
  defHttp.put(`/api/waf/bind`, { data })

/** 删除WAF绑定的节点 */
export const deleteApiWafBindNodeApi: CommonAPI<
  '/api/waf/bind-node',
  'delete'
> = (data) => defHttp.delete(`/api/waf/bind-node`, { data })

/** 查询WAF绑定的节点 */
export const getApiWafBindNodeQueryApi: CommonAPI<
  '/api/waf/bind-node/query',
  'get'
> = (params) => defHttp.get(`/api/waf/bind-node/query`, { params })
/** 绑定WAF节点IDS */
export const getApiWafBindNodeIdsApi: CommonAPI<
  '/api/waf/bind-node/list',
  'get'
> = (params) => defHttp.get(`/api/waf/bind-node/list`, { params })
/** 查询WAF条件 */
export const getApiWafConditionQueryApi: CommonAPI<
  '/api/waf/condition/query',
  'get'
> = (params) => defHttp.get(`/api/waf/condition/query`, { params })

/** 获取WAF */
export const getApiWafGetApi: CommonAPI<'/api/waf', 'get'> = (params) =>
  defHttp.get(`/api/waf`, { params })

/** 更新WAF优先级 */
export const updateApiWafPriorityApi: CommonAPI<'/api/waf/priority', 'put'> = (
  data
) => defHttp.put(`/api/waf/priority`, { data })

/** 查询WAF */
export const getApiWafQueryApi: CommonAPI<'/api/waf/query', 'get'> = (params) =>
  defHttp.get(`/api/waf/query`, { params })

/** 更新WAF状态 */
export const updateApiWafStatusApi: CommonAPI<'/api/waf/status', 'put'> = (
  data
) => defHttp.put(`/api/waf/status`, { data })
/** 添加节点绑定WAF */
export const addWafNodeBindApi: CommonAPI<'/api/waf/node-bind', 'post'> = (
  data
) => defHttp.post(`/api/waf/node-bind`, { data })

/** 删除节点绑定WAF */
export const deleteWafNodeUnbindApi: CommonAPI<
  '/api/waf/node-unbind',
  'delete'
> = (data) => defHttp.delete(`/api/waf/node-unbind`, { data })
